package com.example.minademo.service.impl;

import com.example.minademo.dao.ScreenShotDao;
import com.example.minademo.entity.ScreenShot;
import com.example.minademo.service.ScreenShotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ScreenShotServiceImpl implements ScreenShotService {

    @Autowired
    private ScreenShotDao mScreenShotDao;
    @Override
    public List<ScreenShot> findAllByUserIdAndControlledUserId(Integer userId, Integer controlledUserId) {
        return mScreenShotDao.findAllByUserIdAndAndControlledUserId(userId,controlledUserId);
    }

    @Override
    public ScreenShot save(Integer userId, Integer controlledUserId, String imagePath) {
        ScreenShot shot = new ScreenShot();
        shot.setUserId(userId);
        shot.setControlledUserId(controlledUserId);
        shot.setImagePath(imagePath);
        return shot;
    }
}
